﻿app.controller('HomeController', ['$scope', 'NoteFactory', function ($scope, NoteFactory) {
    
    if($scope.$parent.status.isLoggedIn) NoteFactory.getNotes();
    $scope.note = "Enter New Note Information";
    $scope.newNote = {};
    $scope.addNote = function () {
        NoteFactory.addNote($scope.newNote);
        $scope.newNote = {};
    }

}]);
app.controller('HomeController', ['$scope', 'NoteFactory', function ($scope, NoteFactor) {
    $scope.isAdding = false;
    $scope.addNote = {};
    $scope.notes = NoteFactory.movies;

    $scope.createNote = function () {
        NoteFactory.createNote($scope.addNote).then(function (data) {
            $scope.isAdding = false;
            $scope.addNote = {};
        }, function (data) {
            alert(data)
        });
    };

    $scope.deleteNote = function (id) {
        NoteFactory.deleteNote(id).then(function (data)
            function (data));
            };
        })};